<template>
	<view class="content">
		<view class="content-tit" >
			<view class="tit-le">
				<image :src="item.memberPhoto || infoImg" mode=""></image>
				<view class="le-text">
					<view class="">
						{{item.memberName}}
					</view>
					<u-rate :count="count" size="24" active-color="#FF7C54" v-model="item.evaluate"></u-rate>
					<!-- <view class="tit-ri">
						轻清茶*5瓶
					</view> -->
				</view>
			</view>
			<view class="tit-ri">
				{{item.createTime}}
			</view>
		</view>
		<view class="content-text">
			{{item.content}}
		</view>
		<view class="content-img" v-if="item.photoUrl">
			<!-- 循环显示图片，最多展示三张 -->
			<view v-for="(image, index) in item.photoUrl.slice(0, 3)" :key="index" class="img-item">
				<image :src="image.src" mode="aspectFill" class="img"></image>
			</view>

			<!-- 如果图片数量超过三张，显示 "展示更多" -->
			<view v-if="images.length > 3" class="show-more" @click="goreView(item)">
				展示更多
			</view>
		</view>
	</view>
</template>

<script>
	import config from "../utils/config";
	import {
		getregistration
	} from '../service/api.js'
	export default {
		data() {
			return {
				count:5,
				infoImg: config.ossHost + "2025/01/06/0f26de75078d48d0853a65ff9709b6e0.png",
				images: [{
						src: '../static/home/one.png'
					},
					{
						src: '../static/home/two.png'
					},
					{
						src: '../static/home/three.png'
					},
					{
						src: '../static/home/four.png'
					},
					{
						src: '../static/home/five.png'
					},
				],
			}
		},
		mounted(){
			this.getevaluate();
		},
		props:{
			item: {
				type: Object,
				default: {}
			}
		},
		methods:{
			async getevaluate() {
				let res = await getregistration("evaluate_number");
				if (res.code == 200) {
					this.hierarchicalMap = res.rows;
			
				}
			},
			
			goreView(){}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		font-size: 24rpx;
		color: #1A1A1A;
		// margin-top: 10rpx;
		margin-bottom: 24rpx;

		.content-tit {
			display: flex;
			justify-content: space-between;
			align-items: center;

			.tit-le {
				display: flex;
				align-items: center;

				image {
					width: 64rpx;
					height: 64rpx;
					border-radius: 50%;
					margin-right: 12rpx;
				}

				.le-text {
					view:last-child {
						margin-top: 5rpx;
					}
				}
			}

			.tit-ri {
				font-size: 20rpx;
				color: #808080;
			}
		}

		.content-text {
			margin-top: 16rpx;
		}

		.content-img {
			margin-top: 8rpx;

			image {
				width: 120rpx;
				height: 120rpx;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
			}
		}
	}

	.content-img {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 20rpx;
		padding-top: 24rpx;
	}

	.img-item {
		display: flex;
		justify-content: center;
	}

	.img {
		width: 100%;
		height: 100%;
		border-radius: 5px;
	}

	.show-more {
		width: 100%;
		text-align: center;
		color: #0066cc;
		cursor: pointer;
		font-size: 14px;
		margin-top: 10px;
	}
</style>